1. Field of the Invention
This invention is related to processors and virtualization, and more particularly to delivering interrupts to virtual machine guests.
2. Description of the Related Art
Virtualization has been used in computer systems for a variety of different purposes. For example, virtualization can be used to execute privileged software in a “container” to prevent the privileged software from directly accessing and/or making changes to at least some of the physical machine state without first being permitted to do so by a virtual machine manager (VMM) that controls the virtual machine. Such a container can prevent “buggy” or malicious software from causing problems on the physical machine. Additionally, virtualization can be used to permit two or more privileged programs to execute on the same physical machine concurrently. The privileged programs can be prevented from interfering with each other since access to the physical machine is controlled. Privileged programs may include operating systems, and may also include other software which expects to have full control of the hardware on which the software is executing. In another example, virtualization can be used to execute a privileged program on hardware that differs from the hardware expected by the privileged program.
Generally, virtualization of a processor or computer system may include providing one or more privileged programs with access to a virtual machine (the container mentioned above) over which the privileged program has full control, but the control of the physical machine is retained by the VMM. The virtual machine may include a processor (or processors), memory, and various peripheral devices that the privileged program expects to find in the machine on which it is executing. The virtual machine elements may be implemented by hardware that the VMM allocates to the virtual machine, at least temporarily, and/or may be emulated in software. Each privileged program (and related software in some cases, such as the applications that execute on an operating system) may be referred to herein as a guest. Virtualization may be implemented in software (e.g. the VMM mentioned above) without any specific hardware virtualization support in the physical machine on which the VMM and its virtual machines execute. However, virtualization may be simplified and/or achieve higher performance if some hardware support is provided.
One issue that can arise with virtualization is the latency of interrupt delivery. As mentioned above, peripheral devices can be allocated for use by a virtual machine (to act as the virtual peripheral device in the virtual machine). Such peripheral devices can generate interrupts that are to be processed by the software in the virtual machine. In non-virtualized environments, the interrupt processing latency can be relatively short. In virtualized environments, the interrupts can generally be intercepted by the VMM, processed by the VMM, and delivered to the targeted virtual machine by the VMM using a software mechanism of some sort. However, the interrupt processing latency can be significantly greater (about 100 times longer, for example).